<? include 'server_config.php'; 


$verify_code = $_GET['key'];

if($verify_code!="")
{
	$sql="
		SELECT user_idx FROM ndd_user WHERE verify_code = '$verify_code' AND mail = '".$_GET['user']."';";

//echo $sql;
	$result = mysql_query($sql,$connect);
	$row = mysql_fetch_row($result);

	$_SESSION['user_idx'] = $row[0];

	$findpw = true;
}
else
{
	$findpw = false;
}

if($_SESSION['user_idx'] == "")
{
	?>
	<script>

		<?
	if($findpw)
	{

			?>
		alert("보안상의 이유로 현재 코드는 더이상 사용하실 수 없습니다. 다시 비밀번호 찾기 요청을 해 주세요.");
				<?
	}
			?>
		location.href='nddg_login.php';
	</script>
	<?
	return;
}





?>





<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> 넥도닥 [NextDoorDoctor] :: 멘토-멘티 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style>
a:link {text-decoration:none} 
a:visited {text-decoration:none} 
a:active {text-decoration:none} 
a:hover {color:blue;text-decoration:none} 
</style>
	<script type="text/javascript" src="./js/jquery-1.6.2.min.js"></script>
 </head>

 <body style="line-height: 160%; font-size: 12px; font-family: '굴림'; padding: 0px; margin: 0px;  ">
  <table border=0 width='1000px' align='center'>
	

<?
include "nddg_top_menu.php";
?>	

	<tr>
		<td>
			<div style='width:700px;float:left;'>
				<b>비밀번호를 변경합니다.</b><br>
				<br>



				<form name="fwrite" action="nddg_member_pw_proc.php"  method="post" enctype="multipart/form-data"  id="fwrite">
				
					<input type='hidden' name='findpw' value='<?=$findpw?>'>
	<? 
	if(!$findpw)
	{
		?>
						기존 비밀번호<br>
						<input type="password" name="prev_password"><br>
						<br>
	<?
	}
					?>

						새 비밀번호<br>
						<input type="password" name="new_password"><br>
						<br>
						
						새 비밀번호 확인<br>
						<input type="password" name="new_password_confirm"><br>
						<br>
						
						<input type='button' value='확인'  onclick="fwrite.submit();" style="cursor:pointer">
						
				
				</form>

			</div>

			<div style='width:300px;float:left;'>
				
			</div>




			
		</td>
	</tr>

<?
include "nddg_footer.php";
?>	

  </table>



<iframe src='' name='ifr_temp' style='display:none;'></iframe>



	</div>
 </body>
</html>
